Optimal. Leaf size=34 \[ b^2 x-\frac {2 a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a^2 \cot (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2868, 3855,
3091, 8} \begin {gather*} -\frac {a^2 \cot (e+f x)}{f}-\frac {2 a b \tanh ^{-1}(\cos (e+f x))}{f}+b^2 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2868
Rule 3091
Rule 3855
Rubi steps
\begin {align*} \int \csc ^2(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \csc (e+f x) \, dx+\int \csc ^2(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {2 a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a^2 \cot (e+f x)}{f}+b^2 \int 1 \, dx\\ &=b^2 x-\frac {2 a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a^2 \cot (e+f x)}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(76\) vs. \(2(34)=68\).
time = 0.17, size = 76, normalized size = 2.24 \begin {gather*} \frac {-a^2 \cot \left (\frac {1}{2} (e+f x)\right )+2 b \left (b e+b f x-2 a \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+2 a \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )+a^2 \tan \left (\frac {1}{2} (e+f x)\right )}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.23, size = 46, normalized size = 1.35
method | result | size |
derivativedivides | \(\frac {-a^{2} \cot \left (f x +e \right )+2 a b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+b^{2} \left (f x +e \right )}{f}\) | \(46\) |
default | \(\frac {-a^{2} \cot \left (f x +e \right )+2 a b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+b^{2} \left (f x +e \right )}{f}\) | \(46\) |
risch | \(b^{2} x -\frac {2 i a^{2}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f}\) | \(67\) |
norman | \(\frac {b^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+b^{2} x \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {a^{2}}{2 f}-\frac {a^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+\frac {a^{2} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+\frac {a^{2} \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+2 b^{2} x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {2 a b \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}\) | \(159\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 56, normalized size = 1.65 \begin {gather*} \frac {{\left (f x + e\right )} b^{2} - a b {\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {a^{2}}{\tan \left (f x + e\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 84 vs.
\(2 (36) = 72\).
time = 0.41, size = 84, normalized size = 2.47 \begin {gather*} \frac {b^{2} f x \sin \left (f x + e\right ) - a b \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) + a b \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - a^{2} \cos \left (f x + e\right )}{f \sin \left (f x + e\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (e + f x \right )}\right )^{2} \csc ^{2}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 79 vs.
\(2 (36) = 72\).
time = 0.46, size = 79, normalized size = 2.32 \begin {gather*} \frac {2 \, {\left (f x + e\right )} b^{2} + 4 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) + a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \frac {4 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a^{2}}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.83, size = 105, normalized size = 3.09 \begin {gather*} \frac {2\,b^2\,\mathrm {atan}\left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+2\,a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{2\,a\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )-b\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f}-\frac {a^2\,\mathrm {cot}\left (e+f\,x\right )}{f}+\frac {2\,a\,b\,\ln \left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________